package com.zjitc.p1.config;

import com.zjitc.obj.Teacher;
import com.zjitc.obj.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/6 15:46
 * @description:
 */
@Configuration
public class JavaConfigDemo1 {
  @Bean(value = "user")
  public User user(){
    User user=new User("lzh",20);
    return user;
  }


  @Bean
  public Teacher teacher(User user){
    return  new Teacher(user);
  }

  @Bean(value = "u1")
  public User user1(){
    return new User("java config demo1",0);
  }

  @Bean(value = "u2")
  public User user2(){
    return new User("java config demo2",1);
  }
}

